import React from 'react';

export default function Main({ list, handleDelById }) {
  return (
    <ul>
      {list.map((item) => (
        <li key={item.id}>
          <h3>评论人: {item.username}</h3>
          <p>评论内容：{item.content}</p>
          <button onClick={() => handleDelById(item.id)}>删除</button>
        </li>
      ))}
    </ul>
  );
}
